package com.res.share.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.res.share.model.ResArt;
import com.baomidou.mybatisplus.extension.service.IService;
import com.res.share.model.dto.ArticleModel;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 资源 服务类
 * </p>
 *
 * @author astupidcoder
 * @since 2021-09-13
 */
public interface IResArtService extends IService<ResArt> {

    /**
     * 最新咨询
     * @return
     * @param userId
     * @param type
     */
    List<ArticleModel> findArtsList(Integer userId,Integer type);

    /**
     * 分页查询热点信息
     * @param page
     * @param type
     * @param userId
     * @param resType
     * @param cidList
     * @return
     */
    IPage<ArticleModel> findHotArticleList(Page<ArticleModel> page, Integer type, Integer userId, Integer resType, List<Integer> cidList);

    /**
     *
     * @param page
     * @param userId
     * @param keywords
     * @return
     */
    IPage<ArticleModel> searchArticleList(Page<ArticleModel> page, Integer userId, String keywords);

    /**
     * 投稿列表
     * @param page
     * @param userId
     * @return
     */
    IPage<ArticleModel> findMyReports(Page<ArticleModel> page, Integer userId);

    /**
     * 查询详情
     * @param userId
     * @param articleId
     * @param cId -分类id
     * @param selectType 1-上一篇 2-下一篇
     * @param artType 资源类型
     * @return
     */
    ArticleModel findArtDetail(Integer userId, Integer articleId,Integer cId,Integer selectType,Integer artType);

    /**
     * 猜你喜欢
     * @return
     */
    List<ArticleModel> findLikeArticleList();


    /**
     * 相关推荐
     * @param cidList
     * @return
     */
    List<ArticleModel> recommendArticleList(List<Integer> cidList,Integer artType);

    /**
     * 访问信息
     *
     * @param userId
     * @param articleId
     * @param freeType
     * @return
     */
    String findArtUploadData(Integer userId,Integer articleId,Integer freeType);

    /**
     * 更新浏览量
     * @param articleId
     */
    void updateArticleLookSee(Integer articleId);

    /**
     * 查询详情
     * @param articleId
     * @return
     */
    ResArt findArtDataById(Integer articleId);

    /**
     *
     * @param page
     * @param userId
     * @param tagId
     * @return
     */
    IPage<ArticleModel> findTagArticleList(Page<ArticleModel> page, Integer userId, Integer tagId);

    void updateLeanResource();

    /**
     * 有限制 IP
     * @param title
     * @param content
     * @return
     */
    Map<String,String> findArticelAI(String title, String content);

    /**
     * 没限制
     * @param title
     * @param content
     * @return
     */
    Map<String,String> findArticelAIOne(String title, String content);

    /**
     *
     * @param page
     * @param userId
     * @param beLongUserId
     * @return
     */
    IPage<ArticleModel> findUserSHopResList(Page<ArticleModel> page, Integer userId, Integer beLongUserId);
}
